package com.vader.admin.client.impl;

import com.vader.admin.client.DistributeIdClient;
import com.vader.common.entity.CommonResponse;
import feign.hystrix.FallbackFactory;

/**
 * @author Vader
 * @date 2021/10/6
 **/
public class DistributeIdClientFallback implements FallbackFactory<DistributeIdClient> {

    @Override
    public DistributeIdClient create(Throwable throwable) {
        return new DistributeIdClient() {

            @Override
            public CommonResponse<Long> getId() {
                return CommonResponse.error("-1");
            }
        };
    }
}
